<form id="config-form" class="edit-form form-horizontal" role="form" data-toggle="validator" method="POST" action="shop/configs/edit">
    <div class="alert alert-info-light" style="margin-bottom:10px;">
        <b>温馨提示</b><br>
		修改配置后，需重新进入小程序端才会生效
       <!-- 2、小程序的AppID和AppSecret请在微信公众平台获取<br>-->
    </div>

    <div class="panel panel-default panel-intro">
        <div class="panel-heading">
            <ul class="nav nav-tabs nav-group">
                <li class="active"><a href="#all" data-toggle="tab">全部</a></li>
				<li><a href="#base" data-toggle="tab">基础配置</a></li>

				<li><a href="#withdraw" data-toggle="tab">提现配置</a></li>
				<li><a href="#collection_account" data-toggle="tab">收款账户</a></li>
				<li><a href="#sound" data-toggle="tab">音响配置</a></li>
<!--				<li class="pull-right"><a href="{:url('mall/configs/plugin?name=kdniao')}" title="快递鸟配置" class="dialogit">快递鸟配置</a></li>-->
<!--				<li><a href="#kuaidi" data-toggle="tab">快递配置</a></li>-->


<!--				<li class="pull-right"><a href="{:url('shop/config/plugin?name=epay')}" title="支付配置" class="dialogit">支付配置</a></li>-->
<!--				<li class="pull-right"><a href="{:url('vppz/config/plugin?name=address')}" title="地图配置" class="dialogit">地图配置</a></li>-->
            </ul>
        </div>

        <div class="panel-body">
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane fade active in" id="one">
                    <table class="table table-striped table-config">
                        <tbody>
							<!--基础配置-->
							<tr data-type="base">
								<td width="15%">应用名称</td>
								<td>
									<div class="row">
										<div class="col-sm-8 col-xs-12">
											<div><input type="text" name="row[sitename]" value="{$datas.config['sitename']}" class="form-control" data-rule="required" data-tip="请填写应用名称"/></div>
										</div>
										<div class="col-sm-4"></div>
									</div>
								</td>
							</tr>
							<tr data-type="base">
								<td width="15%">微信小程序appid</td>
								<td>
									<div class="row">
										<div class="col-sm-8 col-xs-12">
											<div><input type="text" name="row[mini_app_id]" value="{$datas.config['mini_app_id']}" class="form-control" data-rule="required" data-tip="请填写应用名称"/></div>
										</div>
										<div class="col-sm-4"></div>
									</div>
								</td>
							</tr>
							<tr data-type="base">
								<td width="15%">微信小程序秘钥</td>
								<td>
									<div class="row">
										<div class="col-sm-8 col-xs-12">
											<div><input type="text" name="row[mini_app_secret]" value="{$datas.config['mini_app_secret']}" class="form-control" data-rule="required" data-tip="请填写应用名称"/></div>
										</div>
										<div class="col-sm-4"></div>
									</div>
								</td>
							</tr>

							<!--提现配置-->
							<tr data-type="withdraw">
								<td width="15%">提现提示文字</td>
								<td>
									<div class="row">
										<div class="col-sm-8 col-xs-12">
											<div><input type="text" name="row[withdrawtips]" value="{$datas.config['withdrawtips']}" class="form-control" data-rule="required" data-tip="请填写提现提示文字"/></div>
										</div>
										<div class="col-sm-4"></div>
									</div>
								</td>
							</tr>
							<tr data-type="withdraw">
								<td width="15%">最低提现金额</td>
								<td>
									<div class="row">
										<div class="col-sm-8 col-xs-12">
											<div><input type="text" name="row[minmoney]" value="{$datas.config['minmoney']}" class="form-control" data-rule="required" data-tip="请填写最低提现金额"/></div>
										</div>
										<div class="col-sm-4"></div>
									</div>
								</td>
							</tr>
							<tr data-type="withdraw">
								<td width="15%">最高提现金额</td>
								<td>
									<div class="row">
										<div class="col-sm-8 col-xs-12">
											<div><input type="text" name="row[maxmoney]" value="{$datas.config['maxmoney']}" class="form-control" data-rule="required" data-tip="请填写最高提现金额"/></div>
										</div>
										<div class="col-sm-4"></div>
									</div>
								</td>
							</tr>

							<tr data-type="collection_account">
								<td width="15%">收款额度描述</td>
								<td>
									<div class="row">
										<div class="col-sm-8 col-xs-12">
											<div><input type="text" name="row[collection_limit]" value="{$datas.config['collection_limit']}" class="form-control" data-rule="required" data-tip="请填写收款额度"/></div>
										</div>
										<div class="col-sm-4"></div>
									</div>
								</td>
							</tr>

							<tr data-type="collection_account">
								<td width="15%">收款额度的客服图片</td>
								<td>
									<div class="row">
										<div class="col-sm-8 col-xs-12">
											<div class="input-group">
												<input id="c-image" data-rule="required" class="form-control" size="50" name="row[kefu_img]" type="text" value="{$datas.config['kefu_img']}">
												<div class="input-group-addon no-border no-padding">
													<span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
													<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
												</div>
												<span class="msg-box n-right" for="c-image"></span>
											</div>
											<ul class="row list-inline faupload-preview" id="p-image"></ul>
										</div>
										<div class="col-sm-4"></div>
									</div>
								</td>
							</tr>

							<tr data-type="sound">
								<td width="15%">音响秘钥ID</td>
								<td>
									<div class="row">
										<div class="col-sm-8 col-xs-12">
											<div><input type="text" name="row[sound_access_key_id]" value="{$datas.config['sound_access_key_id']}" class="form-control" data-rule="required" data-tip="请填写音响秘钥ID"/></div>
										</div>
										<div class="col-sm-4"></div>
									</div>
								</td>
							</tr>
							<tr data-type="sound">
								<td width="15%">音响秘钥</td>
								<td>
									<div class="row">
										<div class="col-sm-8 col-xs-12">
											<div><input type="text" name="row[sound_access_key]" value="{$datas.config['sound_access_key']}" class="form-control" data-rule="required" data-tip="请填写音响秘钥"/></div>
										</div>
										<div class="col-sm-4"></div>
									</div>
								</td>
							</tr>
                        </tbody>
                    </table>
                    <div class="form-group layer-footer">
                        <label class="control-label col-xs-12 col-sm-2"></label>
                        <div class="col-xs-12 col-sm-8">
                            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
                            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>

<script>

    require.callback = function () {
        var tabevent = function () {
            $(document).on("click", ".nav-group li a[data-toggle='tab']", function () {
                var type = $(this).attr("href").substring(1);
                if (type == 'all') {
                    $(".table-config tr").show();
                } else {
                    $(".table-config tr").hide();
                    $(".table-config tr[data-type='" + type + "']").show();
                }
            });
        };


		define('backend/shop/configs', ['jquery', 'form'], function ($, Form) {
            var Controller = {
                index: function () {
                    Form.api.bindevent($("form[role=form]"));
                    tabevent();
                }
            };
            return Controller;
        });

    }

	/**
	require.callback = function () {

		var tabevent = function () {
			$(document).on("click", ".nav-group li a[data-toggle='tab']", function () {
				var type = $(this).attr("href").substring(1);
				if (type == 'all') {
					$(".table-config tr").show();
				} else {
					$(".table-config tr").hide();
					$(".table-config tr[data-type='" + type + "']").show();
				}
			});
		};

		define('backend/vppz/config', ['jquery', 'form'], function ($, Form) {
			var Controller = {
				index: function () {
					Form.api.bindevent($("form[role=form]"));
					tabevent();
				}
			};
			return Controller;
		});
	}
	**/


</script>
